home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / lynx-2.4 / WWW / Library / Implementation / HTTCP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-28  |  2.9 KB  |  108 lines

  1. /*                               /Net/dxcern/userd/timbl/hypertext/WWW/Library/src/HTTCP.html
  2.                                GENERIC TCP/IP COMMUNICATION
  3.                                              
  4.    This module has the common code for handling TCP/IP connections etc.
  5.    
  6.  */
  7. #ifndef HTTCP_H
  8. #define HTTCP_H
  9.  
  10. #ifndef HTUTILS_H
  11. #include "HTUtils.h"
  12. #endif /* HTUTILS_H */
  13. #include "tcp.h"
  14.  
  15. #ifdef SHORT_NAMES
  16. #define HTInetStatus            HTInStat
  17. #define HTInetString            HTInStri
  18. #define HTParseInet             HTPaInet
  19. #endif
  20.  
  21.  
  22. /*      Produce a string for an internet address
  23. **      ---------------------------------------
  24. **
  25. ** On exit:
  26. **           returns a pointer to a static string which must be copied if
  27. **                it is to be kept.
  28. */
  29. #ifdef __STDC__
  30.         extern const char * HTInetString(struct sockaddr_in* sin);
  31. #else
  32.         extern char * HTInetString();
  33. #endif
  34.  
  35.  
  36. /*      Encode INET status (as in sys/errno.h)                    inet_status()
  37. **      ------------------
  38. **
  39. ** On entry:
  40. **              where gives a description of what caused the error
  41. **      global errno gives the error number in the unix way.
  42. **
  43. ** On return:
  44. **      returns a negative status in the unix way.
  45. */
  46. #ifdef __STDC__
  47.         extern int HTInetStatus(char *where);
  48. #else
  49.         extern int HTInetStatus();
  50. #endif
  51.  
  52. /*      Publicly accessible variables
  53. */
  54. /* extern struct sockaddr_in HTHostAddress; */
  55.                         /* The internet address of the host */
  56.                         /* Valid after call to HTHostName() */
  57.  
  58.  
  59. /*      Parse a cardinal value                                 parse_cardinal()
  60. **      ----------------------
  61. **
  62. ** On entry:
  63. **      *pp points to first character to be interpreted, terminated by
  64. **      non 0..9 character.
  65. **      *pstatus points to status already valid,
  66. **      maxvalue gives the largest allowable value.
  67. **
  68. ** On exit:
  69. **      *pp points to first unread character,
  70. **      *pstatus points to status updated iff bad
  71. */
  72.  
  73. extern unsigned int HTCardinal PARAMS((int *pstatus,
  74.                 char            **pp,
  75.                 unsigned int    max_value));
  76.  
  77.  
  78. /*      Parse an internet node address and port
  79. **      ---------------------------------------
  80. **
  81. ** On entry:
  82. **               str points to a string with a node name or number,
  83. **               with optional trailing colon and port number.
  84. **               sin points to the binary internet or decnet address field.
  85. **
  86. ** On exit:
  87. **               *sin is filled in. If no port is specified in str, that
  88. **               field is left unchanged in *sin.
  89. */
  90. #ifdef __STDC__
  91.         extern int HTParseInet(struct sockaddr_in * sin, CONST char * str);
  92.         /*!! had to change this to get it to compile. CTB */
  93. #else
  94.         extern int HTParseInet();
  95. #endif
  96.  
  97. /*      Get Name of This Machine
  98. **      ------------------------
  99. **
  100. */
  101.  
  102. extern CONST char * HTHostName NOPARAMS;
  103.  
  104. #endif   /* HTTCP_H */
  105. /*
  106.  
  107.    End.  */
  108.